<?php
exit;
if (isset($_GET['op'])){
    $openid=$_GET['op'];
}else{
    exit;
}
$isLock=true;
//$url='.';
$url='https://tu-10030004.file.myqcloud.com/k517';
?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>上海</title>
<style>
html,body{font-size:16px;background:#fff5d2;width:100%;font-size:12px;color:#000000;font-family:Microsoft YaHei, Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;}
body, div{position:relative;padding:0px;margin:0px auto;max-width:750px;}
.weui-dialog{position:fixed;z-index:5000;width:80%;max-width:300px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#FFF;text-align:center;border-radius:3px;overflow:hidden}.weui-dialog__hd{padding:1.3em 1.6em .5em}.weui-dialog__title{font-weight:400;font-size:18px}.weui-dialog__bd{padding:0 1.6em .8em;min-height:40px;font-size:15px;line-height:1.3;word-wrap:break-word;word-break:break-all;color:#999}.weui-dialog__bd:first-child{padding:1.2em 20px .1em;color:#353535}.weui-dialog__ft{position:relative;line-height:48px;font-size:18px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3CC51F;text-decoration:none;-webkit-tap-highlight-color:transparent;position:relative}.weui-dialog__btn:active{background-color:#EEE}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:#353535}.weui-dialog__btn_primary{color:#0BB20C}@media screen and (min-width:1024px){.weui-dialog{width:35%}}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,.6)}
.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}
.js_dialog{display:none;}
.weui-toast {position: fixed;z-index: 5000;width: 7.6em;min-height: 7.6em;top: 180px;left: 50%;margin-left: -3.8em;background: rgba(17, 17, 17, 0.7);text-align: center;border-radius: 5px;color: #FFFFFF;}
.weui-toast__content {
    margin: 0 0 15px;
}
-webkit-touch-callout:none;
-webkit-user-select:none;
html{-ms-touch-action:none;}
div,img{-webkit-tap-highlight-color:rgba(0,0,0,0);}
*{-webkit-text-size-adjust: none;}
.simg{position:absolute;display:block;}
a{text-decoration:none;}
.txt{position:absolute;text-indent:8px;font-size:12px;z-index:2;border:none;background:transparent;}
.txt::-webkit-input-placeholder {color:#a0a09b;text-align:left;}
input {
    outline:none;
    border:none;
    outline-color: "red";
    -webkit-transform: translate3d(0, 0, 0);
}
select{position:absolute;display:block;background:transparent;border:0px;text-indent:8px;font-size:12px;-webkit-appearance:none;}
input:-internal-autofill-selected, .txt:-internal-autofill-selected{background:transparent;}
.container{position:relative;width:100%;height:auto;overflow-x:hidden;}
.p1{opacity:0;}
 
.p2-txt{position:absolute;font-size:13px;text-align:center;color:#000;}
.fade-in{opacity:1;-webkit-transition:opacity 1s ease-in-out;-moz-transition: opacity 1s ease-in-out;-o-transition: opacity 1s ease-in-out;transition: opacity 1s ease-in-out;}
.p-bg{top:0px;left:0px;}
.l100{position:absolute;width:100%;left:0;display:block;}
.p-b, .thebg{position:absolute;width:100%;top:0;left:0;} 
.t-bg{position:absolute;display:none;width:100%;height:100%;top:0;left:0;background-color:#000;opacity:.8;z-index:9;}
.page{position:absolute;display:none;width:100%;height:100%;top:0;left:0;}
.p1-1{top:0;}
.hide{display:none;}
.p3-li{position:absolute;overflow-y:scroll;}
.p3-li img{width:100%;display:block;}
.p3-li::-webkit-scrollbar {width: 4px;}
.p3-li::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background   : #8b8385;
}
.p3-li::-webkit-scrollbar-track {
border-radius: 4px;
background   : #ededed;
}
.p1-jr{z-index:6;}
.ti-up, .ti-next{position:absolute;z-index:2;}
.ti-title{position:absolute;font-size:16px;width:100%;text-align:center;font-weight:700;}
.dx-bt, .duox-bt, .pduan-bt{position:absolute;width:80%;left:10%;font-size:14px;line-height:24px;color:#666666;}

.dx-abcd, .duox-abcd, .pduan-abcd{position:absolute;width:86%;left:8%;}
.dx-li, .pduan-li{position:relative;width:100%;font-size:12px;vertical-align:middle;color:#333333;}
.pduan-li{font-size:14px;}
.dx-li-ico{position:absolute;}
.dx-li-ico img{position:absolute;width:100%;height:100%;}
.d-hui{background:transparent url('<?php echo $url; ?>/img/h.png') no-repeat;background-size:cover;}
.d-red{background:transparent url('<?php echo $url; ?>/img/r.png') no-repeat;background-size:cover;}
.d-hui2{background:transparent url('<?php echo $url; ?>/img/h2.png') no-repeat;background-size:cover;}
.d-red2{background:transparent url('<?php echo $url; ?>/img/r2.png') no-repeat;background-size:cover;}

.ti-t1{position:absolute;z-index:3;display:none;}
.ti-t1-2{background:transparent url('<?php echo $url; ?>/img/ti-t1-2.png') no-repeat;background-size:cover;}
.ti-timedt{position:absolute;color:#df0c12;font-weight:700;font-size:16px;text-align:center;width:100%;z-index:3;}
.end-pop, .endtime-pop{position:absolute;z-index:9;display:none;width:100%;height:100%;background:rgba(0, 0, 0, 0.8);;top:0px;left:0px;}
.end-pop-t1{top:25%;}
.end-pop-t1 img{width:100%;display:block;}
.end-pop-close{position:absolute;width:60%;height:35%;left:20%;top:56%;}
@media only screen and (min-width: 740px) {
    .ti-title{font-size:40px;}
     .dx-bt, .duox-bt, .pduan-bt{width:78%;left:11%;font-size:22px;line-height:38px;}
    .dx-li{font-size:18px;}
    .ti-timedt{font-size:40px;}
}
</style></head>
<body>
<div class="container">
  <div class="p1 page">
      <div class="thebg">
        <img class="l100 p1-1" src="<?php echo $url; ?>/img/p1.jpg" />
        <div class="p1-jr simg"></div>
     </div>
  </div>
  
  <div class="p2 page">
     <div class="thebg">
        <img class="l100 p1-1" src="<?php echo $url; ?>/img/p2.jpg" />
        <input id="p2-name" class="txt" name="p2-name" type="text" value="" placeholder="请填写学生姓名" />
        <!--  <input id="" class="txt" name="p2-school" type="text" value="" placeholder="" />
       --> 
       <select id="p2-school" class="txt">
         <option value="">请选择所在学校</option>
         <?php 
         $school=['上海中侨职业技术大学','上海旅游高等专科学校','上海出版印刷高等专科学校','上海城建职业学院','上海工艺美术职业学院','上海农林职业技术学院','上海行健职业学院','上海交通职业技术学院','上海电子信息职业技术学院（五年一贯制）','上海民航职业技术学院','上海海事职业技术学院','上海科学技术职业学院','上海南湖职业技术学院（五年一贯制）','上海东海职业技术学院','上海工商职业技术学院','上海民远职业技术学院','上海思博职业技术学院','上海济光职业技术学院','上海工商外国语职业学院','上海邦德职业技术学院','上海震旦职业学院（五年一贯制）','上海电影艺术职业学院','上海应用技术大学','上海电机学院','上海健康医学院','上海公安学院','上海第二工业大学','上海中医药大学','上海工程技术大学','上海商学院','上海体育学院','上海立信金融会计学院','上海建桥学院','上海杉达学院','上海立达学院'];
         foreach ($school as $v){
         ?>
         <option value="<?php echo $v; ?>"><?php echo $v; ?></option>
        <?php } ?>
        </select>
        <input id="p2-phone" class="txt" name="p2-phone" type="number" value="" placeholder="请填写可联系的真实手机号码" />
        <input id="p2-idcard" class="txt" name="p2-idcard" type="text" value="" placeholder="请填写参赛本人的身份证号" />
        <div class="p2-jr simg"></div>
     </div>
  </div>
  
  <div class="p3 page">
     <div class="thebg">
         <img class="l100 p1-1" src="<?php echo $url; ?>/img/p3.jpg?v=1" />
         <div class="p3-li">
            <img src="<?php echo $url; ?>/img/rtxt.png?v=1" />
         </div>
         <div class="p3-jr simg"></div>
     </div>
  </div>
  
  <div class="tdx page">
    <div class="thebg">
     <img class="l100 p1-1" src="<?php echo $url; ?>/img/tdx.jpg" />
     <div class="tip-b1 simg go-dx"></div>
    </div> 
  </div>
  <div class="tduo page">
    <div class="thebg">
     <img class="l100 p1-1" src="<?php echo $url; ?>/img/tduo.jpg" />
     <div class="tip-b1 simg go-duo"></div>
    </div> 
  </div>
  <div class="tpd page">
    <div class="thebg">
     <img class="l100 p1-1" src="<?php echo $url; ?>/img/tpd.jpg" />
     <div class="tip-b1 simg go-pd"></div>
    </div> 
  </div>
  
  <img class="ti-t1" src="<?php echo $url; ?>/img/ti-t1.png" />
  <div class="ti-t1 ti-t1-2"></div>
  <div class="danxt page">
     <div class="ti-timedt">00:00</div>
     <div class="thebg">
       <img class="l100 p1-1" src="<?php echo $url; ?>/img/ti.jpg" />
       <div class="ti-title">第一题 （1/20）</div>
       <!--  <div class="dx-bt dx-t1">习近平总书记到山西考察调研。从北京直飞
吕梁，随后驱车1个半小时来到兴县，参观
晋绥边区革命纪念馆，向革命烈士敬献花篮。
习近平说，革命战争年代，吕梁儿女用鲜血
和生命铸就了伟大的吕梁精神。我们要把这
种精神用在当今时代.</div>
        <div class="dx-abcd dx-t1">
        <div class="dx-li" data-id="a"><div class="dx-li-ico dx-li-a d-hui"><img src="./img/a.png" /></div><span>我们一定不能忘记为革命成功</span></div>
        <div class="dx-li" data-id="b"><div class="dx-li-ico dx-li-b d-hui"><img src="./img/b.png" /></div><span>洒热血的前辈们</span></div>
        <div class="dx-li" data-id="c"><div class="dx-li-ico dx-li-c d-hui"><img src="./img/c.png" /></div><span>不能忘记为抵抗</span></div>
        <div class="dx-li" data-id="d"><div class="dx-li-ico dx-li-d d-hui"><img src="./img/d.png" /></div><span>日本军国主义侵略</span></div>
        </div> -->
        <?php include 'template/dx.php'; ?>
       <img class="ti-up ti-upb" src="<?php echo $url; ?>/img/ti-h.png" />
       <img class="ti-next ti-netb" src="<?php echo $url; ?>/img/ti-h.png" />
       <img class="ti-up dan-up" src="<?php echo $url; ?>/img/up.png" />
       <img class="ti-next dan-next" src="<?php echo $url; ?>/img/next.png" />
     </div>
  </div>
  
  <div class="duoxt page">
     <div class="ti-timedt">00:00</div>
     <div class="thebg">
       <img class="l100 p1-1" src="<?php echo $url; ?>/img/ti.jpg" />
       <div class="ti-title">第一题 （1/20）</div>
 
       <?php include 'template/duo.php'; ?> 
       <img class="ti-up ti-upb" src="<?php echo $url; ?>/img/ti-h.png" />
       <img class="ti-next ti-netb" src="<?php echo $url; ?>/img/ti-h.png" />
       <img class="ti-up duo-up" src="<?php echo $url; ?>/img/up.png" />
       <img class="ti-next duo-next" src="<?php echo $url; ?>/img/next.png" />
     </div>
  </div>
  
  <div class="panduan page">
     <div class="ti-timedt">00:00</div>
     <div class="thebg">
       <img class="l100 p1-1" src="<?php echo $url; ?>/img/ti.jpg" />
       <div class="ti-title">第一题 （1/20）</div>
        <?php include 'template/pan.php'; ?> 
        <div class="pduan-abcd">
        <div class="pduan-li" data-id="a"><div class="dx-li-ico dx-li-a d-hui"><img src="./img/a.png" /></div><span>正 确</span></div>
        <div class="pduan-li" data-id="b"><div class="dx-li-ico dx-li-b d-hui"><img src="./img/b.png" /></div><span>错 误</span></div>
        </div>
       <img class="ti-up ti-upb" src="<?php echo $url; ?>/img/ti-h.png" />
       <img class="ti-next ti-netb" src="<?php echo $url; ?>/img/ti-h.png" />
       <img class="ti-up pan-up" src="<?php echo $url; ?>/img/up.png" />
       <img class="ti-next pan-next" src="<?php echo $url; ?>/img/next.png" />
     </div>
  </div>
  
  <div class="end-pop">
      <div class="end-pop-t1 l100">
         <img src="<?php echo $url; ?>/img/end.png" />
         <div class="end-pop-close"></div>
      </div>
  </div>
  
  <div class="endtime-pop">
      <div class="end-pop-t1 l100">
         <img src="<?php echo $url; ?>/img/tless.png" />
         <div class="end-pop-close"></div>
      </div>
  </div>
 
  <div class="js_dialog">
       <div class="weui-mask"></div>
       <div class="weui-dialog">
                <div class="weui-dialog__bd weui-msg"></div>
                <div class="weui-dialog__ft">
                    <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary weui-btn">知道了</a>
                </div>
        </div>
  </div>
  
</div>
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.0.0/jquery.min.js"></script>
<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
if(h<_rate*1246){
	h=_rate*1246;
}
function setKe(cname, cvalue){
	var cname='z1'+cname;
    var d = new Date();
    d.setTime(d.getTime() + (1*60*60*1000));
    var expires = "expires="+ d.toUTCString();
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getke(cname) {
	var cname='z1'+cname;
    var name = cname + "=";
    var decodedCookie = decodeURIComponent(document.cookie);
    var ca = decodedCookie.split(';');
    for(var i = 0; i <ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
         }
         if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
         }
     }
    return "";
}

function chinanum(num){
    var china = new Array('零','一','二','三','四','五','六','七','八','九');  
    var arr = new Array();
    var num=num+'';
    var english = num.split("")  
    for(var i=0;i<english.length;i++){
        arr[i] = china[english[i]];
    }
    if(2 == english.length){
        if('一' == arr[0]){
        	return ('十'+arr[1]);
        }else{
        	return (arr[0]+'十'+arr[1]);
        }
    }else{
    	return arr.join("")  
    }
}
Array.prototype.shuffle = function(){
	  let array = this;
	  let len = array.length;
	  for (let i = len - 1; i > 0; i--) {
	    let j = Math.floor(Math.random() * (i + 1));
	    [array[i], array[j]] = [array[j], array[i]];
	  }
}
function isMobile() {
	  return (/phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|webOS|android/i.test(navigator.userAgent))
}
var _isMobile=isMobile();
var _sOpenid='<?php echo $openid; ?>';
var _ckOpenid=getke('sz_openid');
var _openid=_sOpenid;
if(_ckOpenid !=''){
	_openid=_ckOpenid;
}
setKe('sz_openid', _openid);
var _curTiId=0;
$(function(){
	$(".p1").show().addClass("fade-in");
	$('.p-b').height(_rate*1206);
	$('.container, .page').width(sWidth).height(h);
	$('.p1-jr').width(_rate*250).height(_rate*120).css({"top":_rate*870, "left":_rate*236});
	  
	$('#p2-name').width(_rate*400).height(_rate*78).css({"top":_rate*462, "left":_rate*248});
	$('#p2-school').width(_rate*400).height(_rate*78).css({"top":_rate*594, "left":_rate*248});
	$('#p2-phone').width(_rate*400).height(_rate*78).css({"top":_rate*729, "left":_rate*248});
	$('#p2-idcard').width(_rate*400).height(_rate*78).css({"top":_rate*862, "left":_rate*248});
	$('.p2-jr').width(_rate*270).height(_rate*120).css({"top":_rate*1020, "left":_rate*246});
	$('.p3-li').width(_rate*600).height(_rate*880).css({"top":_rate*70, "left":_rate*68});
	$('.p3-jr').width(_rate*270).height(_rate*120).css({"top":_rate*1010, "left":_rate*226});
	$('.ti-up, .ti-next').width(_rate*288).height(_rate*103);
	$('.ti-up').css({"top":_rate*1084, "left":_rate*80});
	$('.ti-next').css({"top":_rate*1084, "left":_rate*380});
	$(".tip-b1").width(_rate*490).height(_rate*120).css({"top":_rate*900, "left":_rate*130});
	$('.dx-bt').css({"top":_rate*250});
	$('.ti-title').css({"top":_rate*170});
	$('.dx-abcd, .pduan-abcd').css({"top":_rate*560});
	$('.dx-li, .pduan-li').height(_rate*70).css({"line-height":_rate*70+'px','margin-bottom':_rate*48});
	$(".dx-abcdt101").css({"top":_rate*388});
	$(".dx-abcdt89").css({"top":_rate*488});
	$(".dx-li2").css({"line-height":_rate*70+'px','margin-bottom':_rate*140});
	 
	$('.dx-li-ico').width(_rate*73).height(_rate*60).css({"top":_rate*2, "left":0});
	$('.dx-li span, .pduan-li span').css({"margin-left":_rate*73});
	$('.ti-t1').width(_rate*523).height(_rate*36).css({"top":_rate*86, "left":_rate*103});
	$(".ti-t1-2").width(0);
	$('.ti-timedt').css({"top":_rate*36});
 
	if(sWidth > 740){
		$('.dx-abcd, .pduan-abcd').css({"top":_rate*476});
		$('.dx-li, .pduan-li').height(_rate*70).css({"line-height":_rate*70+'px','margin-bottom':_rate*66});
		 
	}

	var _userCurStepCookie=getke('sz_uCurStep');
	var _sbuCurStep='';
	var _curTiIdCookie=getke('sz_curtiid');
	
	$('.p2-jr').click(function(){
		 var _name=$("#p2-name").val();
		 var _school=$("#p2-school").val();
		 var _phone=$("#p2-phone").val();
	     var _idcard=$("#p2-idcard").val();
           if('' == _name){
        	   _popMsg("请填写学生姓名");
               return;  
           }
           if('' == _school){
        	   _popMsg("请选择所在学校");
               return;  
           }
           if('' == _phone){
        	   _popMsg("请填写可联系的真实手机号码");
               return;  
           }
           if(_phone.length < 6){
        	   _popMsg("请填写真实的手机号码");
               return;  
           }
	       if('' == _idcard){
	    	   _popMsg("请填写参赛本人的身份证号");
	           return;  
	       }
	       if(_idcard.length < 5){
        	   _popMsg("请填写真实的身份证号");
               return;  
           }
	       $.post("./api/?c=setu", {op:_openid,n:_name,s:_school,p:_phone,idc:_idcard}, function(data){
	           if('n' == data.s){
	        	   _popMsg("信息提交失败");
	               return; 
	           }
	           if('y' == data.s){
	        	   $(".p2").hide();
	        	   $(".p3").show();
	        	   setKe('sz_isreg', 'y');
	           }  
		   }, "json");
		 

	});
	
    if(!('placeholder' in document.createElement('input')) ){   
	    $('input[placeholder],textarea[placeholder]').each(function(){var that = $(this),text= that.attr('placeholder');   
	      if(that.val()===""){that.val(text).addClass('placeholder');}   
	      that.focus(function(){if(that.val()===text){that.val("").removeClass('placeholder');}})   
	      .blur(function(){if(that.val()===""){that.val(text).addClass('placeholder');}})   
	      .closest('form').submit(function(){   
	        if(that.val() === text){that.val('');}});});   
	}
	$(".weui-btn").click(function(){
        $(".js_dialog").hide();
	});
	function _popMsg(msg){
		$(".weui-msg").html(msg);
        $(".js_dialog").show();
	}
	$('.p1-jr').click(function(){

		if('doend' == _userCurStepCookie || 'endtime' == _userCurStepCookie){
			_popMsg("考试已完成");
            return;
		}
		var _ckTmp=getke('sz_isreg');
		if('' != _ckTmp){
			$(".p1").fadeOut();
	        $(".p3").fadeIn();
		}else{
			$(".p1").fadeOut();
	        $(".p2").fadeIn();
		}
	});
	$('.p3-jr').click(function(){
		$.post("api/?c=gettime", {id:1}, function(data){
            if('k' == data.s){
            	$(".p3").fadeOut();
                $(".tdx").fadeIn();
        }else{
           	_popMsg("考试暂未开始");
               return;
            }
         }, "json");
	});

	var endDate = new Date();
	var _min=endDate.getMinutes();
	endDate.setMinutes(_min+30);
	end = endDate.getTime();


	var _tmpEndTime=getke('sz_endtime2');
	if('' == _tmpEndTime){
		setKe('sz_endtime2', end);
	}else{
		end=_tmpEndTime;
    }
	var _ttuwidth=_rate*523;
	function countTime(){
		var date = new Date();  
		var now = date.getTime();
		var leftTime = end-now; 
		var m,s; 
		if (leftTime >= 0){
			m = Math.floor(leftTime/1000/60%60);
			s = Math.floor(leftTime/1000%60);
			var _tmpS=':'+s;
			if(s<10){
				_tmpS=':0'+s;
			}
			var _percent=1 - leftTime/1799898 + 0.02;
			$(".ti-t1-2").width(_percent*_ttuwidth);
			if(_percent>1){_percent=1;}
			$(".ti-timedt").html(m + _tmpS );
			setTimeout(countTime,1000); 
		}else{
		  setKe('sz_uCurStep', 'endtime');
		  $(".ti-timedt").html("00:00");
		  $(".endtime-pop").fadeIn();
		  if('dan' == _sbuCurStep){
			  $.post("./api/?c=setdx", {tm:_dxData,op:_openid}, function(data){}, "json");
		  }
		  if('duo' == _sbuCurStep){
			  $.post("./api/?c=setduo", {tm:_duoData,op:_openid}, function(data){}, "json");
		  }
          if('pan' == _sbuCurStep){
        	  $.post("./api/?c=setpan", {tm:_panData,op:_openid}, function(data){}, "json");
		  }
		}
	}
	function _getABCD(){
	      var _data='';
	      if(1 == _duoxABCD.a){
	    	  _data+='a';
	      }
	      if(1 == _duoxABCD.b){
	    	  _data+='b';
	      }
	      if(1 == _duoxABCD.c){
	    	  _data+='c';
	      }
	      if(1 == _duoxABCD.d){
	    	  _data+='d';
	      }
	      return _data;
	}
	$('.go-dx').click(function(){
    	$(".tdx").fadeOut();
        $(".danxt, .ti-t1").fadeIn();
        countTime();
        _curTiId=0;
        _curTiVal='';
        setKe('sz_curtiid', 0);
        var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/75）");
  
	});
	$('.go-duo').click(function(){
        $(".tduo").fadeOut();
        $(".duoxt, .ti-t1").fadeIn();
        _curTiId=0;
        _curTiVal='';
        setKe('sz_curtiid', 0);
        var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/15）");

		$(".duoxt .dx-bt, .duoxt .dx-abcd").hide();
		$(".duo-t"+_duoShuf[_curTiId]).show();
		
	});
	$('.go-pd').click(function(){
        $(".tpd").fadeOut();
        $(".panduan, .ti-t1").fadeIn();
        _curTiId=0;
        _curTiVal='';
        setKe('sz_curtiid', 0);
        var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/10）");

		$(".panduan .dx-bt").hide();
		$(".pan-t"+_panShuf[_curTiId]).show();
		
	});
	
	var _curTiVal='';
	$(".danxt .dx-li").click(function(){
		var _id=$(this).attr("data-id");
		_curTiVal=_id;
		console.log(_id);
		_dxData[_danShuf[_curTiId]]=_curTiVal;
		console.log(_dxData);
		setKe('sz_tmData', JSON.stringify(_dxData));
		setKe('sz_uCurStep', 'dan');
		_sbuCurStep='dan';
		
		$(".dx-t"+_danShuf[_curTiId]+" .dx-li-ico").removeClass("d-red").addClass("d-hui");
		if('a' == _id){
			$(".dx-t"+_danShuf[_curTiId]+" .dx-li-a").addClass("d-red").removeClass("d-hui");
		}
		if('b' == _id){
			$(".dx-t"+_danShuf[_curTiId]+" .dx-li-b").addClass("d-red").removeClass("d-hui");
		}
		if('c' == _id){
			$(".dx-t"+_danShuf[_curTiId]+" .dx-li-c").addClass("d-red").removeClass("d-hui");
		}
		if('d' == _id){
			$(".dx-t"+_danShuf[_curTiId]+" .dx-li-d").addClass("d-red").removeClass("d-hui");
		}
	});

	$(".pduan-li").click(function(){
		var _id=$(this).attr("data-id");
		_curTiVal=_id;
		_panData[_panShuf[_curTiId]]=_curTiVal;
		$(".pduan-li .dx-li-ico").removeClass("d-red").addClass("d-hui");
		if('a' == _id){
			$(".pduan-li .dx-li-a").addClass("d-red").removeClass("d-hui");
		}
		if('b' == _id){
			$(".pduan-li .dx-li-b").addClass("d-red").removeClass("d-hui");
		}
		setKe('sz_tmData', JSON.stringify(_panData));
		setKe('sz_uCurStep', 'pan');
		_sbuCurStep='pan';
	});

	var _duoxABCD={a:'',b:'',c:'',d:''};
	$(".duoxt .dx-li").click(function(){
		var _id=$(this).attr("data-id");
		if('a' == _id){
			if('' == _duoxABCD.a){
				_duoxABCD['a']=1;
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-a").addClass("d-red2").removeClass("d-hui2");
			}else{
				_duoxABCD['a']='';
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-a").addClass("d-hui2").removeClass("d-red2");
			}
		}
		if('b' == _id){
			if('' == _duoxABCD.b){
				_duoxABCD['b']=1;
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-b").addClass("d-red2").removeClass("d-hui2");
			}else{
				_duoxABCD['b']='';
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-b").addClass("d-hui2").removeClass("d-red2");
			}
		}
		if('c' == _id){
			if('' == _duoxABCD.c){
				_duoxABCD['c']=1;
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-c").addClass("d-red2").removeClass("d-hui2");
			}else{
				_duoxABCD['c']='';
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-c").addClass("d-hui2").removeClass("d-red2");
			}
		}
		if('d' == _id){
			if('' == _duoxABCD.d){
				_duoxABCD['d']=1;
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-d").addClass("d-red2").removeClass("d-hui2");
			}else{
				_duoxABCD['d']='';
				$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-d").addClass("d-hui2").removeClass("d-red2");
			}
		}
		_duoData[_duoShuf[_curTiId]]=_getABCD();
		console.log(_duoData);
		setKe('sz_tmData', JSON.stringify(_duoData));
		setKe('sz_uCurStep', 'duo');
		_sbuCurStep='duo';
	});

	

    var _danshufCookie=getke('sz_danshuf');
    if('' == _danshufCookie){
    	var _danShuf=[];
        for(var i=1;i<=102;i++){
        	_danShuf.push(i);
        }
        _danShuf.shuffle();
        for(var i=1;i<=26;i++){
            _danShuf.pop();
        }
        setKe('sz_danshuf', _danShuf);
	}else{
		var _danShuf=_danshufCookie.split(",");
	}
    console.log(_danShuf);
    
	var _dxData={};
	
	if('dan' == _userCurStepCookie){
		var _getTmData=getke('sz_tmData');
		if('' != _getTmData){
			_dxData=JSON.parse(_getTmData);
		}
		_curTiId=parseInt(_curTiIdCookie);
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/75）");
		$(".p1").hide();
		$(".danxt").show();
		countTime();
		$(".ti-t1").fadeIn();
	}
	if('tduo' == _userCurStepCookie){
		$(".p1").hide();
		$(".tduo").show();
		countTime();
	}
 
	console.log(_curTiId);
	$(".dx-t"+_danShuf[_curTiId]).show();
	$(".dan-next").click(function(){
		console.log(_danShuf[_curTiId]);
		console.log(_dxData);
		if(_curTiId >= 74){ //end
        	$.post("./api/?c=setdx", {tm:_dxData,op:_openid}, function(data){
        		if('y' == data.s){
        			$(".danxt, .ti-t1").hide();
                    $(".tduo").fadeIn(); 
                    setKe('sz_uCurStep', 'tduo');
                    _sbuCurStep='tduo';
                }
            }, "json");
        	return;
        }
		$(".dx-t"+_danShuf[_curTiId]).hide();
		_curTiId++; 
		$(".dx-t"+_danShuf[_curTiId]).show();
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/75）");
		_curTiVal='';
		setKe('sz_curtiid', _curTiId);
		
	});
	$(".dan-up").click(function(){
		if(_curTiId < 1){return;}
		$(".dx-t"+_danShuf[_curTiId]).hide();
		_curTiId--;  
		$(".dx-t"+_danShuf[_curTiId]).show();
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/75）");
		_curTiVal='';
		if (typeof(_dxData[_danShuf[_curTiId]]) != "undefined"){
			var _tmpType=_dxData[_danShuf[_curTiId]];
			var _tmpSetType='';
			if('a' == _tmpType){
				_tmpSetType='a';
			}
			if('b' == _tmpType){
				_tmpSetType='b';
			}
			if('c' == _tmpType){
				_tmpSetType='c';
			}
			if('d' == _tmpType){
				_tmpSetType='d';
			}
			$(".dx-t"+_danShuf[_curTiId]+" .dx-li-"+_tmpSetType).addClass("d-red").removeClass("d-hui");
  
		}
		
	});


	

    var _duoShufCookie=getke('sz_duoShuf');
    if('' == _duoShufCookie){
    	var _duoShuf=[];
        for(var i=1;i<=20;i++){
        	_duoShuf.push(i);
        }
        _duoShuf.shuffle();
        setKe('sz_duoShuf', _duoShuf);
	}else{
		var _duoShuf=_duoShufCookie.split(",");
	}
    console.log(_duoShuf);
    
    var _duoData={};
    if('duo' == _userCurStepCookie){
		var _getTmData=getke('sz_tmData');
		if('' != _getTmData){
			_duoData=JSON.parse(_getTmData);
		}
		_curTiId=parseInt(_curTiIdCookie);
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/15）");
		$(".p1").hide();
		$(".duoxt").show();
		countTime();
		$(".ti-t1").fadeIn();
	}
    if('tpd' == _userCurStepCookie){
    	$(".p1").hide();
		$(".tpd").show();
		countTime();
		 
    }

    
    
    $(".duo-t"+_duoShuf[_curTiId]).show();
    $(".duo-next").click(function(){
    	if(_curTiId >= 14){ //end
        	$.post("./api/?c=setduo", {tm:_duoData,op:_openid}, function(data){
        		if('y' == data.s){
        			$(".duoxt, .ti-t1").hide();
                    $(".tpd").fadeIn();
                    setKe('sz_uCurStep', 'tpd');
                    _sbuCurStep='tpd';
                }
            }, "json");
        	return;
        }
    	$(".duo-t"+_duoShuf[_curTiId]).hide();
		_curTiId++; 
		$(".duo-t"+_duoShuf[_curTiId]).show();
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/15）");
		_duoxABCD={a:'',b:'',c:'',d:''};
		_resetAbcd();
		setKe('sz_curtiid', _curTiId);
    });
    function _resetAbcd(){
    	if (typeof(_duoData[_duoShuf[_curTiId]]) == "undefined"){
            return;
        }
    	var _tmpAbcd=_duoData[_duoShuf[_curTiId]];
    	if(_tmpAbcd.indexOf("a") != -1 ){
    		_duoxABCD.a=1;
    		$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-a").addClass("d-red2").removeClass("d-hui2");
        }
    	if(_tmpAbcd.indexOf("b") != -1 ){
    		_duoxABCD.b=1;
    		$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-b").addClass("d-red2").removeClass("d-hui2");
        }
    	if(_tmpAbcd.indexOf("c") != -1 ){
    		_duoxABCD.c=1;
    		$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-c").addClass("d-red2").removeClass("d-hui2");
        }
    	if(_tmpAbcd.indexOf("d") != -1 ){
    		_duoxABCD.d=1;
    		$(".duo-t"+_duoShuf[_curTiId]+" .dx-li-d").addClass("d-red2").removeClass("d-hui2");
        }
    }
    $(".duo-up").click(function(){
    	if(_curTiId < 1){return;}
		$(".duo-t"+_duoShuf[_curTiId]).hide();
		_curTiId--;  
		$(".duo-t"+_duoShuf[_curTiId]).show();
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/15）");
    	_duoxABCD={a:'',b:'',c:'',d:''};
    	_resetAbcd();
 
    	console.log(_duoData);
    });


    var _panShufCookie=getke('sz_panShuf');
    if('' == _panShufCookie){
    	var _panShuf=[];
        for(var i=1;i<=20;i++){
        	_panShuf.push(i);
        }
        _panShuf.shuffle(); 
        setKe('sz_panShuf', _panShuf);
	}else{
		var _panShuf=_panShufCookie.split(",");
	}
    console.log(_panShuf);
    
    var _panData={};
    if('pan' == _userCurStepCookie){
		var _getTmData=getke('sz_tmData');
		if('' != _getTmData){
			_panData=JSON.parse(_getTmData);
		}
		_curTiId=parseInt(_curTiIdCookie);
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/10）");
		$(".p1").hide();
		$(".panduan").show();
		$(".ti-t1").fadeIn();
    countTime();
	}

	 
    $(".pan-t"+_panShuf[_curTiId]).show();
    $(".pan-next").click(function(){
    	if(_curTiId >= 9){ //end
        	$.post("./api/?c=setpan", {tm:_panData,op:_openid}, function(data){
        		if('y' == data.s){
        			$(".end-pop").fadeIn();
        			setKe('sz_uCurStep', 'doend');
        			_sbuCurStep='doend';
                }
            }, "json");
        	return;
        } 
       $(".pduan-li .dx-li-ico").removeClass("d-red").addClass("d-hui");
       $(".pan-t"+_panShuf[_curTiId]).hide();
		_curTiId++; 
		$(".pan-t"+_panShuf[_curTiId]).show();
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/10）");
		console.log(_panData);
		if (typeof(_panData[_panShuf[_curTiId]]) != "undefined"){
			if('a' == _panData[_panShuf[_curTiId]]){
				$(".pduan-li .dx-li-a").addClass("d-red").removeClass("d-hui");
			}
			if('b' == _panData[_panShuf[_curTiId]]){
				$(".pduan-li .dx-li-b").addClass("d-red").removeClass("d-hui");
			}
		}
		setKe('sz_curtiid', _curTiId);
    });

    $('.end-pop-close').click(function(){
		_popMsg("考试已完成");
        return; 
	});
    
    $(".pan-up").click(function(){
    	if(_curTiId < 1){return;}
    	$(".pduan-li .dx-li-ico").removeClass("d-red").addClass("d-hui");
		$(".pan-t"+_panShuf[_curTiId]).hide();
		_curTiId--;  
		$(".pan-t"+_panShuf[_curTiId]).show();
		var _zwen=chinanum(_curTiId+1);  
		$(".ti-title").html("第"+_zwen+"题（"+(_curTiId+1)+"/10）");
		if (typeof(_panData[_panShuf[_curTiId]]) != "undefined"){
			if('a' == _panData[_panShuf[_curTiId]]){
				$(".pduan-li .dx-li-a").addClass("d-red").removeClass("d-hui");
			}
			if('b' == _panData[_panShuf[_curTiId]]){
				$(".pduan-li .dx-li-b").addClass("d-red").removeClass("d-hui");
			}
		}
    });

    if(h > _rate*1206){
		   var _cha= h - _rate*1246;
		   if(_cha > 0){
		      $('.thebg').css({"top":_cha/3});
		   }
	}
    
});
</script>
</body>
</html>